#! /usr/bin/env node
const { program } = require('commander')
// const chalk = require('chalk')
const createApi= require('./cmd/createApi')
const createPage= require('./cmd/createPage')
program.command('api')
.description('根据openapi生成api文件')
.option("-f, --openapiUrl <string>", "openapi文件地址")
.option("-p, --apiPath <string>", "生成接口method的目录")
.option("-c, --cutPath <string>", "裁剪接口路径前缀")
.action(createApi)

program.command('crud')
.description('根据openapi生成通用页面')
.option("-m, --modelUrl <string>", "根据接口读取模型")
.option("-p, --path <string>", "指定生成文件路径")
.option("-d, --drawer", "生成抽屉页面")
.option("-a, --useAi", "使用AI优化模型")
.option("-w, --aiWord <string>", "扩展提示词")
.action(createPage)


program.parse()